<form class="application-modal-form" role="form" ng-submit="generateToken()">
  <div class="modal-header">
    <button type="button" class="close" ng-click="cancel()">
      <span aria-hidden="true">&times;</span>
      <span class="sr-only">Close</span>
    </button>
    <h3 class="modal-title" translate="home.applicationToken.headerLabel">Generate Application Token</h3>
  </div>
  <div class="modal-body">
    <div ng-hide="isGeneratingTokenSucceed">
      <div class="alert alert-danger alert-dismissible" role="alert"
           ng-repeat="issue in issues">

        <button type="button" class="close" data-dismiss="alert">
          <span aria-hidden="true">&times;</span>
          <span class="sr-only">Close</span>
        </button>
        {{issue}}
      </div>

      <p ng-hide="isGeneratingToken" translate="home.applicationToken.confirmationMessage"></p>
      <p ng-show="isGeneratingToken" translate="home.applicationToken.generatingTokenMessage"></p>
    </div>

    <div class="alert alert-success alert-dismissible" role="alert"
         ng-show="isGeneratingTokenSucceed && !isRestartInProgress"
         translate="home.applicationToken.successMessage">
    </div>

    <div class="alert alert-success alert-dismissible" role="alert"
         ng-show="isRestartInProgress"
         translate="home.restart.successMessage">
    </div>


  </div>
  <div class="modal-footer" ng-hide="isRestartInProgress">
    <button type="reset" class="btn btn-default"
            ng-click="cancel()" translate="global.form.no" ng-disabled="isGeneratingToken">No</button>

    <button type="submit" ng-hide="isGeneratingTokenSucceed"
            class="btn btn-primary" translate="global.form.generate" ng-disabled="isGeneratingToken">Generate</button>

    <button ng-show="isGeneratingTokenSucceed" ng-click="restart()"
            class="btn btn-primary" translate="global.form.restart">Restart</button>
  </div>
</form>
